1. Technical Field
The present invention relates in general to data processing systems. More particularly, the present invention relates to storage systems implemented within data processing systems. Still more particularly, the present invention relates to recovering data from a data processing system.
2. Description of the Related Art
Almost all computer systems require some sort of storage capacity. This storage capacity can be used for storing computer code for applications, utilities, and operating systems, or data processed by an application program.
Relatively early in the development of computer systems, disk drives became a fundamental device for storage. Accordingly, most computer systems rely on a file system for storing and retrieving files from a disk. The file system defines the directory structure for keeping track of the files and the path syntax required to access the files. The file system also defines the way files are named and the maximum file size of the file or volume. A file system generally consists of two distinct parts, a collection of files and a directory structure. The directory structure organizes and provides information about the files in the file system.
Some of the greatest difficulties concerning file systems relate to corruption and errors as a result of system crashes or write errors to the disk drive. Before data is written to a storage system, data is usually sent to a disk cache. The disk cache is a buffer allocated in the main memory and is intended to increase the speed of input/output (I/O) operations by permitting rapid temporary storage of data while awaiting disk access for write operations or by caching data which is expected to be requested prior to receipt of a read request. Problems occur when there is a system crash or failure before the data in the disk buffer has been written to the physical disk. In this case, upon reboot of the system, the system will operate in an inconsistent manner, since the system believes that the data has been written to the disk drive but, in actuality, the data has not been written to the disk drive due to the system failure. For example, a file may be deleted in the disk cache, but this deletion may not have actually been performed on the physical disk and the file still remains on the physical disk.
When a file system inconsistency is encountered, a well-known solution is to utilize a file system check program, such as fsck in Unix-based environments and Scandisk in Microsoft WINDOWS environments. Generally, a file system check program is run automatically at boot time when the system detects that a file system is in an inconsistent state, indicating a less than graceful shutdown, such as a crash or power loss. Typically, file system check program utilities provide options for interactively repairing damaged file systems (the user must decide how to fix specific problems), allowing the file system check program to decide how to fix specific problems (so the user does not have to answer any questions), or reviewing the problems that need to be resolved on a file system without actually fixing them. While file system check programs provide the user with a useful tool for repairing file systems damaged by a system crash or other types of abnormal system shutdowns, the time required to run the programs can be extensive, especially with today's high-capacity disk drives.
To solve this problem, journaling systems, which are well-known in the art, not only log every transaction on the metadata into a log, but log every single operation within each transaction. In the event of a system failure, the system merely has to access the log file and perform a recovery operation to return the file system to a consistent state.
Despite the implementation of journaling systems, file systems may still encounter errors when writing to the journal log. In the past, an error encountered when writing to a log of a journaling system results in the loss of all the log data and subsequent loss of more file system metadata. Therefore, there is a need for a system and method for recovering from errors generated while writing to and reading from a journaling file system log file.